﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.ComponentModel;
using System.Device.Location;
using Microsoft.Phone.Controls.Maps;

namespace Util.Maps
{
    public class MapData : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;

        private void RaisedPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        private GeoCoordinate mapCenter = new GeoCoordinate(-33.866567, 151.219254);
        public GeoCoordinate MapCenter
        {
            get { return this.mapCenter; }
            set
            {
                if (this.mapCenter == value) return;
                this.mapCenter = value;
                this.RaisedPropertyChanged("MapCenter");
            }
        }

        private double zoom = 14.0;
        public double Zoom
        {
            get { return this.zoom; }
            set
            {
                if (this.zoom == value) return;
                this.zoom = value;
                this.RaisedPropertyChanged("Zoom");
            }
        }

        /*
        private ObservableCollection<PinData> pins = new ObservableCollection<PinData>() { 
            new PinData(){PinLocation= new GeoCoordinate(-33.866567, 151.219254), 
                          Data=new string[]{"Mary", "Bob","Joe","Frank", 
                                            "Beth","Nick","Jeff","Alex"} },
            new PinData(){PinLocation= new GeoCoordinate(-33.876567, 151.219254) , 
                          Data=new string[]{"Frank", "Beth"} }};
        public ObservableCollection<PinData> Pins
        {
            get { return pins; }
        }*/

        private PinData selectedPin;
        public PinData SelectedPin
        {
            get { return this.selectedPin; }
            set
            {
                if (this.selectedPin == value) return;
                this.selectedPin = value;
                this.RaisedPropertyChanged("SelectedPin");
            }
        }

        private LocationCollection routePoints = new LocationCollection();
        public LocationCollection RoutePoints
        {
            get { return routePoints; }
        }

    }
}
